package org.shopen.puremvc.view.components.drawingcanvas
{
	import flash.filters.*;
	
	/**
	 * Factory of filters. 
	 * @author Андрій
	 * 
	 */	
	public class BitmapFilterFactory
	{
		    public static const BEVEL_FILTER:String = "BevelFilter";
		    public static const BLUR_FILTER:String = "BlurFilter";
		    public static const COLOR_MATRIX_FILTER:String = "ColorMatrixFilter";
		    public static const CONVOLUTION_FILTER:String = "ConvolutionFilter";
		    public static const DISPLACEMENT_MAP_FILTER:String = "DisplacementMapFilter";
			public static const DROP_SHADOW_FILTER:String = "DropShadowFilter";
		    public static const GLOW_FILTER:String = "GlowFilter";
		    public static const GRADIENT_BEVEL_FILTER:String = "GradientBevelFilter";
		    public static const GRADIENT_GLOW_FILTER:String = "GradientGlowFilter";
			
		    public static function createFilter(type : String) : BitmapFilter
		    {
		    	var result : BitmapFilter = null;
		    	switch (type)
		    	{
		    		case BEVEL_FILTER:
		    			result = new BevelFilter();
		    			break;
		    		case BLUR_FILTER:
		    			result = new BlurFilter();
		    			break;
		    		case COLOR_MATRIX_FILTER:
		    			result = new ColorMatrixFilter();
		    			break;
		    		case CONVOLUTION_FILTER:
		    			result = new ConvolutionFilter();
		    			break;
		    		case DISPLACEMENT_MAP_FILTER:
		    			result = new DisplacementMapFilter();
		    			break;
		    		case DROP_SHADOW_FILTER:
		    			result = new DropShadowFilter();
		    			break;
		    		case GLOW_FILTER:
		    			result = new GlowFilter();
		    			break;
		    		case GRADIENT_BEVEL_FILTER:
		    			result = new GradientGlowFilter();
		    			break;
		    		case GRADIENT_GLOW_FILTER:
		    			result = new GradientBevelFilter();
		    			break;
		    	}
		        return result;
		    }
	}
}